home *** CD-ROM | disk | FTP | other *** search
/ APDL Eductation Resources / APDL Eductation Resources.iso / programs / electronic / rlab / TestMatrix / rq_r < prev    next >
Encoding:
Text File  |  1994-05-25  |  538 b   |  23 lines

  1. //-------------------------------------------------------------------//
  2.  
  3. // Synopsis:    Rayleigh quotient.
  4.  
  5. // Syntax:    rq ( A , x )
  6.  
  7. // Description:
  8.  
  9. //    R is the Rayleigh quotient of A and x, x'*A*x/(x'*x).
  10.  
  11. //      Called by FV.
  12.  
  13. //    This file is a translation of rq.m from version 2.0 of
  14. //    "The Test Matrix Toolbox for Matlab", described in Numerical
  15. //    Analysis Report No. 237, December 1993, by N. J. Higham.
  16.  
  17. //-------------------------------------------------------------------//
  18.  
  19. rq = function ( A , x )
  20. {
  21.   return x'*A*x/(x'*x);
  22. };
  23.